package com.imeem.api;

import java.security.NoSuchAlgorithmException;

import com.imeem.api.exceptions.InitializationException;
import com.imeem.api.services.MediaService;
import com.imeem.api.services.PlaylistService;

/**
 * The primary class for interacting with the imeem APIs.
 * @author bestrada
 */
public class Imeem
{
   private final MediaService _mediaService;
   private final PlaylistService _playlistService;
   
  /**
   * constructs a new imeem object
   * @param apiKey your imeem developer key
   * @param secret your imeem developer secret
   */
   public Imeem(String apiKey, String secret) throws InitializationException
   {
      try
      {
         _mediaService = new MediaService(apiKey, secret);
         _playlistService = new PlaylistService(apiKey, secret);
      }
      catch (NoSuchAlgorithmException e)
      {
         throw new InitializationException("could not initialize services", e);
      }
   }
  
   public MediaService media() { return _mediaService; }
   public PlaylistService playlists() { return _playlistService; }
}
